
export type IconProps = {
    size?:number;
    color?:string;
    stroke?:string;
    fill?:string;
    className?:string;
    strokeWidth?:number;
    strokeLinecap?:'butt'|'round'|'square';
    strokeLinejoin?:'miter'|'round'|'bevel';
};

const defaultProps:IconProps = {
    size: 16,
    strokeWidth: 3,
    strokeLinecap: 'round',
    strokeLinejoin: 'round',
};

export default function IconWrapper(props:IconProps, render:{(props:IconProps):string}) {
    if(!props.color) {
        props.color = 'currentColor';
    }

    if(!props.fill) {
        props.fill = props.color;
    }

    if(!props.stroke) {
        props.stroke = props.color;
    }

    return render(Object.assign({}, defaultProps, props));
}
